package org.scboy.gateway.loads;

import org.apache.dubbo.config.annotation.DubboReference;
import org.scboy.dbms.api.IPermissionManager;
import org.scboy.utils.caches.dbms.entity.PermissionEntity;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableCaching
public class LoadAuthPersmission {

	@DubboReference
	IPermissionManager manager;

	@Cacheable(value="DBMS_PERMISSION_CACHE",key="#appName+#path",unless="#result == null")
	public PermissionEntity loadPersmission(String appName,String path){
		return manager.getPermission(appName,path);
	}
}
